package com.designPattern.proxy.dynamic;

import com.designPattern.proxy.staticproxy.ITeacherDao;
import com.designPattern.proxy.staticproxy.TeacherDao;

/**
 *
 */
public class Client2 {
    public static void main(String[] args) {
        //创建动态代理类
        ProxyFactory proxyFactory = new ProxyFactory(new TeacherDao());
        //调用获取获取被动态代理后的实例对象
        ITeacherDao teacherDao = (ITeacherDao) proxyFactory.getProxyInstance();
        //调用被代理后的方法
        teacherDao.teach();
    }
}
